<?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 *
 * @package    symfony
 * @subpackage plugin
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id$
 */
class zdOnlineFilter extends sfFilter
{
  public function execute ($filterChain)
  {
  	//and !$this->getContext()->getUser()->hasCredential('admin')
    if($this->getContext()->getUser()->isAuthenticated() )
    {
    	
    	$user = $this->getContext()->getUser()->getProfile();
    	$user->setSesid($this->getContext()->getRequest()->getCookie('symfony'));
    	$user->setTime(time());
    	$user->setIsOnline(true);
    	$user->save();
   
   //echo $this->getContext()->getUser()->getAttribute('sessid');
   
  }
   $filterChain->execute();
  }
}
